// type:0 =>2021-09-12 默认
// type:1 =>2021-09-12 10:34:12
// type:2 =>09-12 10:34:12
// type:3 =>09-12 
// type:4 =>2021/09/12 
// type:5 =>2021/09/12 10:34:12
// type:6 =>09/12 10:34:12
// type:7 =>09/12 
// type:8 =>2022-04-26 星期二
// type:9 =>2022-04-26 星期二 09:42:23 
// type:10 =>星期二
var filterTime = function (type = 0) {
    // console.log('type', type)
    let date = new Date()
    let y = date.getFullYear();
    let m = (date.getMonth() + 1 + '').padStart(2, '0');
    let d = (date.getDate() + '').padStart(2, '0');
    let hh = (date.getHours() + '').padStart(2, '0')
    let mm = (date.getMinutes() + '').padStart(2, '0')
    let ss = (date.getSeconds() + '').padStart(2, '0')
    let day = (date.getDay() + '')
    let time;
    switch (type) {
        case 0:
            time = `${y}-${m}-${d}`;
            break;
        case 1:
            time = `${y}-${m}-${d} ${hh}:${mm}:${ss}`;
            break;
        case 2:
            time = `${m}-${d} ${hh}:${mm}:${ss}`;
            break;
        case 3:
            time = `${m}-${d}`;
            break;
        case 4:
            time = `${y}/${m}/${d}`;
            break;
        case 5:
            time = `${y}/${m}/${d} ${hh}:${mm}:${ss}`;
            break;
        case 6:
            time = `${m}/${d} ${hh}:${mm}:${ss}`;
            break;
        case 7:
            time = `${m}/${d}`;
            break;
        case 8:
            time = `${y}-${m}-${d} 星期${"日一二三四五六".charAt(day)}`;
            break;
        case 9:
            time = `${y}-${m}-${d} 星期${"日一二三四五六".charAt(day)} ${hh}:${mm}:${ss}`;
            break;
        case 10:
            time = `星期${"日一二三四五六".charAt(day)}`;
            break;
    }
    return time;
}
export {
    filterTime
}